﻿@model ShoppingCart
@if (Model.Items.Count > 0)
{      
    <div class="shopping-cart">
        @*<div id="cart">     
        
        <div id="transfer-tip">
            您目前可享受全场购物免运费</div>
        <div data-shopping-car-points="0" data-user-points="-1" id="point-tip">
            <label>
                抱歉！你的积分不足。</label>
            <span>您目前的积分为：<em>-1</em>分，本次购物需支付：<b>0</b>分，请修改购物车中的积分换购产品。</span>
            <div class="close">
            </div>
        </div>
    </div>*@
        <table class="ui-table ui-table-alpha">
            <thead>
                <tr>
                    <th class="span3">
                        商 品
                    </th>
                    <th class="span1">
                        单价(元)
                    </th>
                    <th class="span2">
                        数 量
                    </th>
                    <th class="span1">
                        优惠(元)
                    </th>
                    <th class="span2">
                        赠送积分
                    </th>
                    <th class="span2">
                        小计(元)
                    </th>
                    <th class="span1">
                        操 作
                    </th>
                </tr>
            </thead>
            <tbody id="general-product">
                @Model.Items.Each(@<tr class="@item.Css">
                    <td title="@(item.Item.Name)">
                        <div class="media">
                            <a class="pull-left" href="@(string.Format("{0}/{1}.html", WebSite.Item, item.Item.Id))" target="_blank">
                                <img data-src="holder.js/64x64" class="media-object" alt="64x64" style="width: 64px;
                                    height: 64px;" src="">
                            </a>
                            <div class="media-body">
                                <h5 class="media-heading">
                                    Media heading</h5>
                                sssssss
                            </div>
                        </div>
                    </td>
                    <td>
                        @(item.Item.UnitPrice.ToString("N"))
                    </td>
                    <td>
                        <div class="input-prepend input-append">
                            <span class="add-on"><a href="@WebHelper.GetCartUrl(item.Item.VariantId, item.Item.Quantity - 1, item.Item.OrderMaxQuantity)"
                                                  onclick ="cartOperate(this);return false;" title="减少"><i class="icon-minus">
                                </i></a></span>
                            <input type="text"  style="width: 20px;" maxlength="3" value="@item.Item.Quantity" name="qty">
                            <span class="add-on"><a href="@WebHelper.GetCartUrl(item.Item.VariantId, item.Item.Quantity + 1, item.Item.OrderMaxQuantity)"
                                                  onclick ="cartOperate(this);return false;" title="增加"><i class="icon-plus">
                                </i></a></span>
                        </div>
                    </td>
                    <td>
                        @(item.Item.Discount.ToString("N"))
                    </td>
                    <td>
                    </td>
                    <td>
                        @(item.Item.SubTotal.ToString("N"))
                    </td>
                    <td>
                        <p>
                            <a  href="@WebHelper.GetCartUrl(item.Item.VariantId)" onclick ="cartOperate(this);return false;">
                                <i class="icon-heart"></i> 收 藏</a>
                        </p>
                        <p>
                            <a  href="@WebHelper.GetCartUrl(item.Item.VariantId)" onclick ="cartOperate(this);return false;">
                                <i class="icon-trash"></i> 删 除</a>
                        </p>
                    </td>
                </tr>
                    )
            </tbody>
        </table>
        <div class="shopping-cart-summary">
            商品重量总计：<span><em>@(Model.Weight)</em>Kg</span> 商品数量总计：<span><em>@(Model.Quantity)</em>件</span>
            商品金额总计：<span><em>@((Model.Total - Model.Discount).ToString("N"))</em>元</span>
        </div>
        <div class="shopping-cart-btn-panel ">
            <div class="row-fluid">
                <div class="span2">
                    <a href="/cart/?opt=2" onclick="cartOperate(this);return false;"><i class="icon-remove">
                    </i>清空购物车</a>
                </div>
                <div class="span7">
                </div>
                <div class="span3">
                    <a href="/checkout" class="ui-btn-order-checkout"></a>
                </div>
            </div>
        </div>
    </div> }
else
{
    <div class="shopping-cart-empty">
        您的购物车中还没有任何商品，现在就去<a href="">购买</a>吧?
    </div>
}
